package ace.cmp.openfeign.core.properties;

import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * @author caspar
 * @date 2023/3/17 10:13
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties(prefix = FeignClientsProperties.CONFIG_PREFIX)
public class FeignClientsProperties {
  public static final String CONFIG_PREFIX = "ace.cloud.openfeign";

  /**
   * 过滤注入本地实现的feign client
   */
  private Exclude exclude;

  /**
   * 过滤需要注入的feign client
   */
  private Exclude feignExclude;

  @Data
  @NoArgsConstructor
  @AllArgsConstructor
  public static class Exclude {
    /**
     * 过滤的feign client name 匹配正则表达式
     */
    private List<String> names;

    /**
     * 过滤的feign client class name 匹配正则表达式
     */
    private List<String> classNames;
  }
}
